package com.czxy.Test;

import com.czxy.domain.Product;
import com.czxy.service.ProductService;
import com.github.pagehelper.PageInfo;

import java.util.List;

public class demo01 {
    public static void main(String[] args) {


//          m01();
//        m02();
//        m03();
//        m04();

    }

    public static void m01() {

        ProductService productService = new ProductService();

        List<Product> list = productService.findAll();

        for (Product p : list) {

            System.out.println(p);
        }


    }


    public static void m02() {

        ProductService productService = new ProductService();

        Product product = new Product();
        product.setPid("30");

        Product p = productService.findByPk(product);

        System.out.println(p);


    }


    public static void m03() {

        ProductService productService = new ProductService();

        PageInfo pageInfo = productService.findByPg(2, 4);
        List<Product> list = pageInfo.getList();

        for (Product p : list) {
            System.out.println(p);
        }

    }


    public static void m04() {

        ProductService productService = new ProductService();


        productService.del("30");





    }

}